import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
/**
 * 全局 css
 */
import '@/assets/style/index.css'
/**
 * 权限设置
 */
import "@/./permission"
/**
 * element-ui使用
 * （1）npm i element-ui -S
 * （2）
 *    import ElementUI from 'element-ui';
 *    import 'element-ui/lib/theme-chalk/index.css';
 * （3）Vue.use(ElementUI);
 */
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 'element-ui/lib/theme-chalk/display.css'
/**
 * 使用字体图标
 */
import '@/utils/fortawsome.js'
/**
 * 工具类
 */
import {goNewPage, isLogin, resetForm} from "@/utils/foodcircle";
/**
 * 时间处理工具类
 */
import moment from 'moment';
/**
 * 全局过滤器
 */
import '@/utils/filter'
/**
 * 全局常量
 */
import Constants from "@/constant"
/**
 * 自定义指令
 */
import permission from './directive/permission'


/**
 * 使用插件
 */
Vue.use(ElementUI)

/**
 * 全局属性
 */
moment.locale('zh-cn');
Vue.prototype.$moment = moment
Vue.prototype.$Constants = Constants

/**
 * 全局方法挂载
 */
Vue.prototype.resetForm = resetForm
Vue.prototype.isLogin = isLogin
Vue.prototype.goNewPage = goNewPage


Vue.prototype.msgSuccess = function (msg) {
    this.$message({showClose: true, message: msg, type: "success"});
}

Vue.prototype.msgError = function (msg) {
    this.$message({showClose: true, message: msg, type: "error"});
}

Vue.prototype.msgInfo = function (msg) {
    this.$message.info(msg);
}

Vue.prototype.msgWarn = function (msg) {
    this.$message.warning(msg);
}


Vue.config.productionTip = false

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
